package com.whyx.project.openapi.business;

import com.alibaba.fastjson.JSONObject;

import java.text.SimpleDateFormat;
import java.util.Date;

public class RemoteUpgrade extends DistributeEntity{
    /*
     *升级类型
     * 0:mcu 1:系统固件 2：app
     */
    public Integer upgradeType;
    /*
     *版本号
     */
    public String vNumber;
    /*
     *同步时间
     */
    public Date synchronizationTime;
    /*
     *Ftpip地址
     */
    public String ftpipAddress;
    /*
     *Ftp端口
     */
    public Integer port;
    /*
     *版本ftp文件地址路径
     */
    public String ftpVersionFileAddress;
    /*
     *文件名
     */
    public String fileName;
    /*
     *Ftp账号
     */
    public String ftpAccount;
    /*
     *Ftp密码
     */
    public String ftpPassword;
    public JSONObject toJSONString()    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        JSONObject object = new JSONObject();
        object.put("upgradeType",upgradeType);
        object.put("vNumber",vNumber);
        object.put("synchronizationTime",sdf.format(synchronizationTime));
        object.put("ftpipAddress",ftpipAddress);
        object.put("port",port);
        object.put("ftpVersionFileAddress",ftpVersionFileAddress);
        object.put("fileName",fileName);
        object.put("ftpAccount",ftpAccount);
        object.put("ftpPassword",ftpPassword);
        object.put("distributeMsgTopic",distributeMsgTopic);
        object.put("devNo",devNo);
        object.put("requestId",requestId);
        object.put("userId",userId);
        object.put("userName",userName);
        object.put("distributeTime",sdf.format(distributeTime));
        object.put("msgId",msgId);
        object.put("serialNo",serialNo);
        return object;
    }

}
